package com.ny.封装;
import com.ny.wlw.Test;

import java.util.ArrayList;
import java.util.List;
public class Demo {

    public static void main (String[] args){

        Emp emp1 = new Emp("01","佩奇",20);
        emp1.setN("01");
        emp1.setName("佩奇");
        emp1.setAge(20);
        System.out.println(emp1);
        Emp emp2 = new Emp("02","suhuoshan",20);
        emp2.setN("02");
        emp2.setName("苏火山");
        emp2.setAge(20);

        Emp emp3 = new Emp("03","孙骚木水",20);

        List<Emp> list = new ArrayList();
        list.add(emp1);
        list.add(emp2);
        list.add(emp3);

        for(int i=0; i<list.size(); i++){
            System.out.println(list.get(i));

        }


    }


}
